package com.xnyzc.lhy.common.penum.pay;

public enum EPayStatus {

    payClose(0, "交易关闭"),
    paySuccess(1, "交易成功");

    private Integer type;
    private String value;

    EPayStatus(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static EPayStatus findById(Integer type) {
        EPayStatus epayStatus;
        switch (type) {
            case 0:
                epayStatus = EPayStatus.payClose;
                break;
            case 1:
                epayStatus = EPayStatus.paySuccess;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return epayStatus;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }
}
